import axios from "../plugins/request";

/**
 * 文章接口
 */

/**
 *
 * 获取文章接口
 */
export const getArticles = (data) => {
  return axios.request({
    url: "articles",
    method: "GET",
    params: data,
  });
};
// 用户
export const getArticlesuser = () => {
  return axios.request({
    url: "articlesuser",
    method: "GET",
  });
};
// 添加分类
export const postArticles = (data) => {
  return axios.request({
    url: "articles",
    method: "POST",
    data,
  });
};
// 分类详情
export const getArticlesItem = (id) => {
  return axios.request({
    url: "articles/" + id,
    method: "GET",
  });
};
// 修改详情
export const putArticlesItem = (id, data) => {
  return axios.request({
    url: "articles/" + id,
    method: "Put",
    data,
  });
};

// 删除分类
export const deleteArticlesById = (id) => {
  return axios.request({
    url: "articles/" + id,
    method: "DELETE",
  });
};
